CFLAGS = -Wall -fpic -coverage -fprofile-arcs -ftest-coverage -lm

adventurerCardTest: adventurerCardTest.c dominion.o rngs.o
	gcc -o adventurerCardTest -g adventurerCardTest.c dominion.o rngs.o $(CFLAGS)

baronCardTest: baronCardTest.c dominion.o rngs.o
	gcc -o baronCardTest -g baronCardTest.c dominion.o rngs.o $(CFLAGS)

buyCardTest: buyCardTest.c dominion.o rngs.o
	gcc -o buyCardTest -g buyCardTest.c dominion.o rngs.o $(CFLAGS)

councilRoomCardTest: councilRoomCardTest.c dominion.o rngs.o
	gcc -o councilRoomCardTest -g councilRoomCardTest.c dominion.o rngs.o $(CFLAGS)

drawCardTest: drawCardTest.c dominion.o rngs.o
	gcc -o drawCardTest -g drawCardTest.c dominion.o rngs.o $(CFLAGS)

greatHallCardTest: greatHallCardTest.c dominion.o rngs.o
	gcc -o greatHallCardTest -g greatHallCardTest.c dominion.o rngs.o $(CFLAGS)

minionCardTest: minionCardTest.c dominion.o rngs.o
	gcc -o minionCardTest -g minionCardTest.c dominion.o rngs.o $(CFLAGS)

salvagerCardTest: salvagerCardTest.c dominion.o rngs.o
	gcc -o salvagerCardTest -g salvagerCardTest.c dominion.o rngs.o $(CFLAGS)

smithyCardTest: smithyCardTest.c dominion.o rngs.o
	gcc -o smithyCardTest -g smithyCardTest.c dominion.o rngs.o $(CFLAGS)

villageCardTest: villageCardTest.c dominion.o rngs.o
	gcc -o villageCardTest -g villageCardTest.c dominion.o rngs.o $(CFLAGS)

testdominion: testdominion.c dominion.o rngs.o interface.o
	gcc -o testdominion -g testdominion.c dominion.o rngs.o interface.o $(CFLAGS)

randomtestcard: randomtestcard.c dominion.o rngs.o
	gcc -o randomtestcard -g randomtestcard.c dominion.o rngs.o $(CFLAGS)
	
randomtestadventurer: randomtestadventurer.c dominion.o rngs.o
	gcc -o randomtestadventurer -g randomtestadventurer.c dominion.o rngs.o $(CFLAGS)
	
cardtest4: cardtest4.c dominion.o rngs.o
	gcc -o cardtest4 -g cardtest4.c dominion.o rngs.o $(CFLAGS)

cardtest3: cardtest3.c dominion.o rngs.o
	gcc -o cardtest3 -g cardtest3.c dominion.o rngs.o $(CFLAGS)

cardtest2: cardtest2.c dominion.o rngs.o
	gcc -o cardtest2 -g cardtest2.c dominion.o rngs.o $(CFLAGS)

cardtest1: cardtest1.c dominion.o rngs.o
	gcc -o cardtest1 -g cardtest1.c dominion.o rngs.o $(CFLAGS)

unittest4: unittest4.c dominion.o rngs.o
	gcc -o unittest4 -g unittest4.c dominion.o rngs.o $(CFLAGS)

unittest3: unittest3.c dominion.o rngs.o
	gcc -o unittest3 -g unittest3.c dominion.o rngs.o $(CFLAGS)

unittest2: unittest2.c dominion.o rngs.o
	gcc -o unittest2 -g unittest2.c dominion.o rngs.o $(CFLAGS)

unittest1: unittest1.c dominion.o rngs.o
	gcc -o unittest1 -g unittest1.c dominion.o rngs.o $(CFLAGS)

rngs.o: rngs.h rngs.c
	gcc -c rngs.c -g  $(CFLAGS)

dominion.o: dominion.h dominion.c rngs.o
	gcc -c dominion.c -g  $(CFLAGS)

playdom: dominion.o playdom.c
	gcc -o playdom playdom.c -g dominion.o rngs.o $(CFLAGS)

testDrawCard: testDrawCard.c dominion.o rngs.o
	gcc -o testDrawCard -g  testDrawCard.c dominion.o rngs.o $(CFLAGS)

badTestDrawCard: badTestDrawCard.c dominion.o rngs.o
	gcc -o badTestDrawCard -g  badTestDrawCard.c dominion.o rngs.o $(CFLAGS)

testBuyCard: testBuyCard.c dominion.o rngs.o
	gcc -o testBuyCard -g  testBuyCard.c dominion.o rngs.o $(CFLAGS)

testAll: dominion.o testSuite.c
	gcc -o testSuite testSuite.c -g  dominion.o rngs.o $(CFLAGS)

interface.o: interface.h interface.c
	gcc -c interface.c -g  $(CFLAGS)

player: player.c interface.o
	gcc -o player player.c -g  dominion.o rngs.o interface.o $(CFLAGS)

finalproject.out: adventurerCardTest baronCardTest buyCardTest councilRoomCardTest drawCardTest greatHallCardTest minionCardTest salvagerCardTest smithyCardTest villageCardTest testdominion dominion.c
	./adventurerCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./baronCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./buyCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./councilRoomCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./drawCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./greatHallCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./minionCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./salvagerCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./smithyCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./villageCardTest >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out
	./testdominion >> finalproject.out
	gcov dominion.c >> finalproject.out
	cat dominion.c.gcov >> finalproject.out

unittestresults.out: unittest1 unittest2 unittest3 unittest4 cardtest1 cardtest2 cardtest3 cardtest4 dominion.c
	./unittest1 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./unittest2 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./unittest3 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./unittest4 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./cardtest1 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./cardtest2 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./cardtest3 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	./cardtest4 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	cat dominion.c.gcov >> unittestresults.out
	
randomtestcard.out: randomtestcard dominion.c
	./randomtestcard >> randomtestcard.out
	gcov dominion.c >> randomtestcard.out
	cat dominion.c.gcov >> randomtestcard.out

randomtestadventurer.out: randomtestadventurer dominion.c
	./randomtestadventurer >> randomtestadventurer.out
	gcov dominion.c >> randomtestadventurer.out
	cat dominion.c.gcov >> randomtestadventurer.out

all: playdom player testDrawCard testBuyCard badTestDrawCard unittest1 unittest2 unittest3 unittest4 cardtest1 cardtest2 cardtest3 cardtest4 randomtestcard randomtestadventurer adventurerCardTest baronCardTest buyCardTest councilRoomCardTest drawCardTest greatHallCardTest minionCardTest salvagerCardTest smithyCardTest villageCardTest finalproject.out

allfinal: adventurerCardTest baronCardTest buyCardTest councilRoomCardTest drawCardTest greatHallCardTest minionCardTest salvagerCardTest smithyCardTest villageCardTest testdominion finalproject.out

clean:
	rm -f *.o playdom.exe playdom test.exe test player player.exe testDrawCard testDrawCard.exe testBuyCard testBuyCard.exe badTestDrawCard badTestDrawCard.exe *.gcov *.gcda *.gcno *.so
